<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> 
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8" />
	<title>系统初始化</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta name="description" content="" />
	<meta name="author" content="" />
	<link rel="shortcut icon" href="<%=request.getContextPath()%>/static/favicon.ico" />
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/bootstrap/css/bootstrap.min.css" />
	<link rel="stylesheet" href="<%=request.getContextPath()%>/static/fonts/font-awesome/css/font-awesome.min.css" />
</head>
<body >
<div class="container">
	<h1>系统安装</h1>
	<blockquote>
		<div class="alert  alert-error">
			<p><i class="icon icon-exclamation-sign"></i> &nbsp;如果您不是第一次次安装系统，本次操作可能会覆盖系统之前的所有数据，请先导出系统之前的数据进行备份。</p>
		</div>
		<p><i class="icon  icon-hand-right"></i> &nbsp;第一步、在您的MYSQL数据库服务器中已新建名为'yf-platform-db'的数据库。</p>
	</blockquote>
	<blockquote>
		<p><i class="icon  icon-hand-right"></i> &nbsp;第二步、设置该数据库的管理员用户为'dbadmin',密码为'741235896'。</p>
		<div class="alert alert-info"><i class="icon  icon-lightbulb"></i> 此处配置必须与应用中的 beans.xml 中的数据源配置一致</div>
	</blockquote>
	<blockquote>
		<p><i class="icon  icon-hand-right"></i> &nbsp;第三步、设置系统管理员帐户信息。</p>
		<form role="form" id="frm-install" class="form-horizontal" method="post" action="<%=request.getContextPath()%>/c?s=common&o=install&isajax=1">
			<div class="control-group">
				<label class="control-label" for="">管理员帐户</label>
				<div class="controls">
					<input type="text" class="form-control" name="usr" id="usr" placeholder="如：admin">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="">管理员密码</label>
				<div class="controls">
					<input type="password" class="form-control" name="pwd" id="pwd" placeholder="密码">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="">确认密码</label>
				<div class="controls">
					<input type="password" class="form-control" name="cfm-pwd" id="cfm-pwd" placeholder="确认密码">
				</div>
			</div>
			<div class="control-group">
				<div class="controls">
					<button type="submit" id="" class="btn btn-success "><i class="icon  icon-ok-sign"></i> 安 &nbsp; &nbsp;装</button>
				</div>
			</div>


		</form>

	</blockquote>
	<blockquote>
		<div class="alert">
			<p><i class="icon icon-spinner"></i> &nbsp;安装过程中请勿退出页面,执行初始化脚本可能需要花费您1到2分中的时间,请耐心等待.</p>
		</div>
		<div class="progress progress-info progress-striped hide">
		  <div class="bar" style="width: 100%"></div>
		</div>
	</blockquote>
	
</div>
<script src="<%=request.getContextPath()%>/static/js/libs/jquery-1.8.3.min.js"></script>
<script src="<%=request.getContextPath()%>/static/js/libs/jquery.form.min.js"></script>
<script src="<%=request.getContextPath()%>/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$("#frm-install").submit(function(){
		$(".progress").addClass("active").show();
		$(this).ajaxSubmit({success:function(rsp){
			console.log(rsp);
			//{"code":0,"msg":"EMPTY MESSAGE","data":{"code":0,"msg":"ok"}}
			if(rsp.code!=0){
				alert(rsp.msg);return;
			}else{
				alert("安装成功")
				$(".progress").removeClass(".active");
			}
		}});
		return false;//阻止表单的默认提交事件
	});
</script>
</body>
</html>